package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TeacherMapper;
import com.ruoyi.system.domain.Teacher;
import com.ruoyi.system.service.ITeacherService;
import com.ruoyi.common.support.Convert;

/**
 * 教师 服务层实现
 * 
 * @author ruoyi
 * @date 2018-12-09
 */
@Service
public class TeacherServiceImpl implements ITeacherService 
{
	@Autowired
	private TeacherMapper teacherMapper;

	/**
     * 查询教师信息
     * 
     * @param teacherId 教师ID
     * @return 教师信息
     */
    @Override
	public Teacher selectTeacherById(Integer teacherId)
	{
	    return teacherMapper.selectTeacherById(teacherId);
	}
	
	/**
     * 查询教师列表
     * 
     * @param teacher 教师信息
     * @return 教师集合
     */
	@Override
	public List<Teacher> selectTeacherList(Teacher teacher)
	{
	    return teacherMapper.selectTeacherList(teacher);
	}
	
    /**
     * 新增教师
     * 
     * @param teacher 教师信息
     * @return 结果
     */
	@Override
	public int insertTeacher(Teacher teacher)
	{
	    return teacherMapper.insertTeacher(teacher);
	}
	
	/**
     * 修改教师
     * 
     * @param teacher 教师信息
     * @return 结果
     */
	@Override
	public int updateTeacher(Teacher teacher)
	{
	    return teacherMapper.updateTeacher(teacher);
	}

	/**
     * 删除教师对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteTeacherByIds(String ids)
	{
		return teacherMapper.deleteTeacherByIds(Convert.toStrArray(ids));
	}
	
}
